package Double_No_Cyclic_LikedeList;

/**
 * Created with IntelliJ IDEA.
 * Description:无头双链表操作的测试函数
 * User: 阿宾
 * Date: 2024-11-11
 * Time: 15:57
 */
public class MyLinkedListTest {
    public static void main(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addFirst(10);
        myLinkedList.addFirst(1);
        myLinkedList.addFirst(1);
        myLinkedList.addFirst(1);
        myLinkedList.display();
        System.out.println(myLinkedList.contains(50));
        System.out.println(myLinkedList.size());
        myLinkedList.addLast(1);
        myLinkedList.addLast(2);
        myLinkedList.addLast(3);
        myLinkedList.addLast(4);

        myLinkedList.display();
        System.out.println(myLinkedList.size());

        myLinkedList.addIndex(0,1);
        myLinkedList.display();
        myLinkedList.addIndex(9,1);
        myLinkedList.display();
        myLinkedList.addIndex(3,222);
        myLinkedList.display();//11 40 30 222 20 10 1 2 3 4 111

        myLinkedList.remove(11);
        myLinkedList.display();
        /*myLinkedList.remove(111);
        myLinkedList.display();
        myLinkedList.remove(222);
        myLinkedList.display();*/
        System.out.println("----------------");
        myLinkedList.removeAllKey(1);
        myLinkedList.display();

        myLinkedList.clear();
        myLinkedList.display();

    }
}
